package com.xielun.fly.framework;

import com.xielun.fly.framework.sql.SQL;
import com.xielun.fly.framework.sql.SQLExecutor;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


public class Node {
    private Node root;
    private String key;
    private Node parent;
    private List<Node> childs = new ArrayList<Node>();
    private Object data;
    private Map<String, Object> temData;


    private Map<String, Object> meta;


    public Map<String, Object> getTemData() {
        return temData;
    }

    public void setTemData(Map<String, Object> temData) {
        this.temData = temData;
    }


    public void setMeta(Map<String, Object> meta) {
        this.meta = meta;
    }

    public void excuteSql() {

        SQL sql = new SQL();
        sql.bind(this);
        try {
        this.data = new SQLExecutor().excute(sql);
            
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


    public Node getParent() {
        return parent;
    }

    public void setParent(Node parent) {
        this.parent = parent;
    }

    public List<Node> getChilds() {
        return childs;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public void setChilds(List<Node> childs) {
        this.childs = childs;
    }

    public Node getRoot() {
        return root;
    }

    public void setRoot(Node root) {
        this.root = root;
    }


    public Map<String,Object> getMeta() {
        return meta;
    }
}
